1 00:00:00,450 --> 00:00:04,470 All right, let's add sound and damage to our boulder on our boulder. 2 00:00:04,920 --> 00:00:09,420 So in order to get sound the easiest way, go to the toolbox. 3 00:00:09,630 --> 00:00:13,830 Go to Marketplace, this first tab under where it says models. 4 00:00:13,830 --> 00:00:20,280 You can go and click on that and then you can see audio and then you could search for different audio 5 00:00:20,280 --> 00:00:21,730 in the toolbox. 6 00:00:21,750 --> 00:00:22,680 I did that. 7 00:00:22,680 --> 00:00:26,010 It took me a really long time and I thought, you know what, I'm just going to save one of these sounds 8 00:00:26,010 --> 00:00:27,450 off so they don't have to suffer. 9 00:00:27,660 --> 00:00:31,500 And I've put it open up your web browser. 10 00:00:32,590 --> 00:00:33,670 On Roblox. 11 00:00:33,820 --> 00:00:34,420 Here's the link. 12 00:00:34,420 --> 00:00:35,740 I'll put it that in the description. 13 00:00:35,740 --> 00:00:36,400 Click on it. 14 00:00:36,400 --> 00:00:38,020 It'll open this page. 15 00:00:38,020 --> 00:00:39,130 This will be green. 16 00:00:39,130 --> 00:00:39,970 It'll say get. 17 00:00:40,000 --> 00:00:46,990 You press it, go to Roblox studio, go to inventory, and then you will get the boulder sound. 18 00:00:46,990 --> 00:00:47,410 Right. 19 00:00:47,500 --> 00:00:48,670 Get the boulder sound. 20 00:00:48,670 --> 00:00:51,340 I'm going to just drag it into my workspace here. 21 00:00:52,210 --> 00:00:55,620 There it is popped up into the workspace, but we need to put it on. 22 00:00:55,630 --> 00:00:58,510 We need to put it in the boulder trap on the boulder. 23 00:00:58,840 --> 00:01:00,880 Just drag that boom boulder. 24 00:01:00,880 --> 00:01:08,230 So if a sound is on a part, is on a part or an attachment in your workspace, as it gets further away, 25 00:01:08,230 --> 00:01:09,790 it's going to start to attenuate. 26 00:01:09,790 --> 00:01:14,830 It's going to get less like like in real life, when sound is further away, it gets less and less and 27 00:01:14,830 --> 00:01:15,280 less. 28 00:01:15,670 --> 00:01:17,590 So that is good. 29 00:01:17,590 --> 00:01:23,770 Let's take a look at our a few of our properties on the Boulder sound. 30 00:01:23,770 --> 00:01:25,180 We could preview it. 31 00:01:27,400 --> 00:01:27,900 Cool. 32 00:01:27,910 --> 00:01:28,630 It'll keep plan. 33 00:01:28,630 --> 00:01:29,440 I just hit the stop. 34 00:01:29,440 --> 00:01:32,320 It'll keep playing because I saved it off as looped. 35 00:01:32,320 --> 00:01:38,060 So if you find your own in the toolbox and you want it to run, as long as the boulders are going loop 36 00:01:38,060 --> 00:01:39,340 does the easiest way. 37 00:01:40,000 --> 00:01:42,260 And then let's take a look down here. 38 00:01:42,280 --> 00:01:43,110 Volume. 39 00:01:43,120 --> 00:01:44,700 It was at 0.5. 40 00:01:44,710 --> 00:01:47,230 I changed it to two to make it loud, right? 41 00:01:47,260 --> 00:01:48,610 It's going to be kind of an event. 42 00:01:48,610 --> 00:01:49,480 So I made it. 43 00:01:49,480 --> 00:01:52,930 I made it four times the sound in volume. 44 00:01:53,230 --> 00:01:57,400 And it also we have roll off max distance. 45 00:01:57,400 --> 00:02:02,290 That's the maximum distance you could be away from the sound and still hear it. 46 00:02:02,290 --> 00:02:03,130 It's really big. 47 00:02:03,130 --> 00:02:04,750 It's at 10,000 studs. 48 00:02:05,440 --> 00:02:09,700 That's all right because this is a big event so we can make it roll far. 49 00:02:09,700 --> 00:02:16,060 The roll off min distance is how far you have to be away before you start hearing some attenuation of 50 00:02:16,060 --> 00:02:16,900 the sound. 51 00:02:17,050 --> 00:02:17,650 Right? 52 00:02:17,650 --> 00:02:21,430 The roll off mode inverse is very much like real life. 53 00:02:21,430 --> 00:02:26,140 They try to mimic real life as it gets further how the sound is going to change. 54 00:02:26,140 --> 00:02:29,380 But you also have a few other options that you can play with. 55 00:02:29,380 --> 00:02:29,650 All right. 56 00:02:29,710 --> 00:02:31,060 I'm not going to go over them. 57 00:02:31,060 --> 00:02:32,290 You can play around with them. 58 00:02:32,290 --> 00:02:33,220 See what you like. 59 00:02:33,760 --> 00:02:34,030 All right. 60 00:02:34,030 --> 00:02:40,960 Let's go ahead and add this sound to our code so that it fires when our when our boulder starts rolling. 61 00:02:41,260 --> 00:02:44,470 So trigger, it actually makes the boulder roll. 62 00:02:44,470 --> 00:02:46,330 So this is where we're going to put our sound. 63 00:02:46,330 --> 00:02:48,070 It's going to be one line of code. 64 00:02:48,910 --> 00:02:49,900 On touch. 65 00:02:49,900 --> 00:02:53,280 When we touch our trigger plate, the bolder is released. 66 00:02:53,290 --> 00:02:55,060 We can put the sound right here. 67 00:02:55,400 --> 00:02:55,660 Right. 68 00:02:55,660 --> 00:02:59,740 So Kerr Boulder is the clone of our boulder. 69 00:02:59,950 --> 00:03:01,510 We'll say Dot. 70 00:03:02,340 --> 00:03:04,010 Boulder sound. 71 00:03:04,820 --> 00:03:08,890 Colon So this is a method that we're going to play, right? 72 00:03:08,960 --> 00:03:10,640 So we're going to play the bolder sound. 73 00:03:10,640 --> 00:03:11,360 That's it. 74 00:03:11,360 --> 00:03:14,540 We can go ahead and play this and we're going to hear that play. 75 00:03:14,540 --> 00:03:16,970 So we already have looped set, though, right? 76 00:03:16,970 --> 00:03:19,550 Because I hit it in the properties. 77 00:03:22,830 --> 00:03:23,700 There comes. 78 00:03:28,830 --> 00:03:29,850 That's pretty cool. 79 00:03:30,070 --> 00:03:31,290 Yeah, that's not bad. 80 00:03:31,290 --> 00:03:32,160 I'm not astounded. 81 00:03:32,310 --> 00:03:33,320 Engineer for sure. 82 00:03:33,330 --> 00:03:37,420 So a lot of you guys probably do better, but it gets you up and running, right? 83 00:03:37,440 --> 00:03:40,890 Let's go and put some damage on that so that when it hits, it hits us. 84 00:03:40,890 --> 00:03:41,820 It kills us. 85 00:03:42,060 --> 00:03:45,120 Hit the stop and let's go to our boulder. 86 00:03:45,120 --> 00:03:50,040 I'm going to put the damage script on the boulder because it's only going to have to do with the boulder 87 00:03:50,040 --> 00:03:54,270 and what the boulder touches, which is going to be us or zombies. 88 00:03:54,300 --> 00:03:57,150 Hit the plus sign on the Boulder script. 89 00:03:57,540 --> 00:03:58,860 Let's call it damage 90 00:04:01,020 --> 00:04:02,040 Damage. 91 00:04:02,830 --> 00:04:10,300 Now go ahead and get a variable for our Boulder Local Boulder equals script dot parent. 92 00:04:10,630 --> 00:04:11,230 Cool. 93 00:04:11,260 --> 00:04:16,480 And then we'll get a function for our on Touch event for the boulder on touch. 94 00:04:17,020 --> 00:04:23,980 Other part, this is much like our healing potion or our little healing pickup. 95 00:04:24,550 --> 00:04:31,780 We need to get the boulder's touched event connected to on touch. 96 00:04:31,780 --> 00:04:32,100 Right? 97 00:04:32,140 --> 00:04:34,630 Make sure there's no little extra parentheses in there. 98 00:04:34,960 --> 00:04:35,920 Just just the name. 99 00:04:35,920 --> 00:04:36,970 Just the name of the function. 100 00:04:38,230 --> 00:04:43,240 If the other part is a character, it might be his head or his torso. 101 00:04:43,270 --> 00:04:45,220 We're going to try and get the humanoid from that. 102 00:04:45,220 --> 00:04:47,620 So other part, let's say it's the head. 103 00:04:47,620 --> 00:04:51,640 If it's the head, the parent is the character and the character. 104 00:04:51,640 --> 00:04:55,660 We can do a find first child. 105 00:04:55,660 --> 00:04:56,940 That's a humanoid. 106 00:04:56,950 --> 00:04:58,240 Ooh, don't spell it wrong. 107 00:04:58,720 --> 00:05:00,970 Humanoid. 108 00:05:01,000 --> 00:05:02,410 I did spell it wrong. 109 00:05:03,520 --> 00:05:07,690 You won't get an error if you spell this wrong, it just won't find it. 110 00:05:07,690 --> 00:05:10,180 And then you'll be wondering why it's not working. 111 00:05:10,610 --> 00:05:10,800 Right. 112 00:05:10,840 --> 00:05:11,770 That's a tough one. 113 00:05:11,770 --> 00:05:16,780 So I'll say if human, then let's say the humanoid exists. 114 00:05:16,780 --> 00:05:25,300 We're going to say human colon, take damage and we'll just make it 20 points. 115 00:05:25,300 --> 00:05:26,830 So it's going to hit us many times. 116 00:05:26,830 --> 00:05:31,030 We don't have a DB out, so it might hit our arm and our head and our torso a lot of different places. 117 00:05:31,030 --> 00:05:33,550 So we only have 100 points to deal with. 118 00:05:33,550 --> 00:05:34,780 It's probably going to kill us. 119 00:05:34,780 --> 00:05:36,760 It's fine because it's a boulder, right? 120 00:05:36,760 --> 00:05:40,150 So it's not unusual for Boulder to kill somebody. 121 00:05:40,840 --> 00:05:42,070 Let's go ahead and try it out. 122 00:05:42,720 --> 00:05:47,250 We got to we got to wait for a little invincibility bubble to go away or we won't get hurt from the 123 00:05:47,250 --> 00:05:47,910 boulder. 124 00:05:50,920 --> 00:05:51,940 There you go. 125 00:05:58,150 --> 00:06:00,290 That's pretty cool, right? 126 00:06:00,340 --> 00:06:01,570 And then we respond. 127 00:06:01,960 --> 00:06:02,770 All right. 128 00:06:03,070 --> 00:06:04,840 Next one, we're going to do badges.